package com.xayy.health.core.enums;

import lombok.Getter;

/**
 * 异常类型枚举
 *
 * @author houchengwei
 * createTime 2023/2/20
 * @version V1.0
 */
public enum AbnormalTypeEnum {
    //中断
    SUSPEND(1,"中断"),
    //丢帧
    FRAME_LOSS(2,"丢帧"),
    //复帧
    MULTIFRAME(3,"复帧"),
    //识别字错误
    RECOGNITION_WORD_ERROR(4,"识别字错误");

    @Getter
    private Integer code;

    @Getter
    private String name;

    AbnormalTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String valueof(Integer index){
        for (AbnormalTypeEnum relationTypeEnum:values()){
            if (relationTypeEnum.getCode().equals(index)) {
                return relationTypeEnum.name;
            }
        }
        return "";
    }
}
